package sk.xorty;

import sk.xorty.domain.Account;

import java.util.Random;

public class AccountFactory {

    private AccountFactory() {}

    private static Random generator = new Random(System.currentTimeMillis());

    public static Account createAccount() {
        Account account = new Account();
        account.setId(String.valueOf(100 + generator.nextInt(900)));
        account.setFirstName("Miso");
        account.setAccountType(generator.nextInt(10));

        return account;
    }

    /**
     * Creates new account
     * @param accountType Channel will use this as priority
     *                    for sorting accounts
     * @return New account
     */
    public static Account createAccount(int accountType) {
        Account account = createAccount();
        account.setAccountType(accountType);

        return account;
    }
}
